import json
file_name = 'username.json'

try:
    with open(file_name) as f_obj:
        user_name = json.load(f_obj)
except FileNotFoundError:
    with open(file_name, 'w') as f_obj:
        user_name = input('What is your name?')
        json.dump(user_name, f_obj)
        print("We'll remember you when you came back, " + user_name + "!")
else:
    print("Welcome back, " + user_name + "!")